﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SharedKernel.Infrastructure.Redis
{
    /// <summary>
    /// redis key常量配置
    /// </summary>
    public class RedisKeyConstConfig
    {
        #region 用户服务 
        private const string UserService_LoginToken = "UserService_LoginToken"; 
        /// <summary>
        /// 获取用户服务登录token key
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public static string UserServiceLoginToken(object userId)
        {
            return $"{UserService_LoginToken}_{userId}";
        }
        #endregion

        #region 网关服务
        private const string ApiGateway_ErrRequestCount = "ApiGateway_ErrRequestCount";
        /// <summary>
        /// 获取网关服务错误请求计数key
        /// </summary>
        /// <param name="ip"></param>
        /// <returns></returns>
        public static string ApiGatewayErrRequestCount(string ip)
        {
            return $"{ApiGateway_ErrRequestCount}_{ip}";
        }
        #endregion
    }
}
